package utils

import (
	"github.com/satori/go.uuid"
	"strings"
)

func UUID(length int) string{
	u1  := uuid.Must(uuid.NewV4())
	str := strings.Replace(u1.String(), "-", "", -1)
	if length > 32 || length < 0 {
		length = 32
	}
	content := str[0 : length]
	return content
}

func UUID8() string{
	return UUID(8)
}

func UUID16() string{
	return UUID(16)
}

func UUID32() string{
	return UUID(16)
}

func GetUuid() string{
	return UUID8()
}